//
//  Person.m
//  2、Person
//
//  Created by student on 16/3/11.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "Person.h"
#import "Dog.h"

@implementation Person

-(instancetype)init{
    if (self=[super init]) {
        [NSTimer scheduledTimerWithTimeInterval:6 target:self selector:@selector(feed:) userInfo:nil repeats:YES];
    }
    return self;
}

-(void)feed:(NSTimer *)t{
    if (self.myDog.hungry<=0) {
        [t invalidate];
    }
    NSLog(@"喂下%@狗粮",self.myDog.fullName);
    self.myDog.hungry +=50;
}

@end
